/**
 * Created by sheng on 2025/7/11.
 */
var img_flag = 1;
let timerId;
let timerId02;
let elapsedTime = 0;

function updateTimer() {
    var newImageUrl="";
//        const imgElement = document.getElementById("drag1img");
    // 获取id为myDiv的div元素
    const divElement = document.getElementById('drag1');
    // 获取该元素的所有计算样式
    //const styles = window.getComputedStyle(divElement);
    //console.log(styles);
    // 在div内部查找第一个h1元素
    const imgElement = divElement.querySelector('img');
//        console.log(imgElement);

    if (img_flag == 1){
//            console.log("11"+img_flag);
        img_flag = 2;
        newImageUrl='https://gips2.baidu.com/it/u=1674525583,3037683813&fm=3028&app=3028&f=JPEG&fmt=auto?w=1024&h=1024';
    }
    else{
//            console.log("22"+img_flag);
        img_flag = 1;
        newImageUrl='https://q0.itc.cn/q_70/images03/20240521/44b541b52c3e4a93a23229c954533263.jpeg';

    }
    imgElement.src = newImageUrl;

}

function yingyongstartTimer() {
    // if (!timerId) {
    //     timerId = setInterval(updateTimer, 5000);
    // }
    // if (!timerId02) {
    //     timerId02 = setInterval(updateText, 1000);
    // }

}

function stopTimer() {
    clearInterval(timerId);
    clearInterval(timerId02);
    timerId = null;
    timerId02 = null;
}
function updateText() {

    // 获取段落元素
    var paragraph = document.getElementById('hello');

    // 更新段落的文本内容
    paragraph.color = paragraph.color==='lightblue'?'red':'lightblue';
    console.log(paragraph.color);
    paragraph.character = paragraph.character==='abc'?'hello':'abc';

    paragraph.bgcolor = paragraph.bgcolor==='black'?'pink':'black';
    console.log(paragraph.querySelector('[slot="title"]'));
    paragraph.querySelector('[slot="title"]').innerText = paragraph.querySelector('[slot="title"]').innerText==='SGC'?'申桂城':'SGC';

}


yingyongstartTimer();
